<?php
global $_CONFIG, $JA_CONFIG, $_module, $_action, $user;
?><!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title><?php echo $_CONFIG['siteName'] .' '. $_CONFIG['ver'];?></title>
        <meta http-equiv="cache-control" content="no-cache" /> 
        <link href="css/style.css" rel="stylesheet" type="text/css" media="screen" /> 
        <!--[if lte IE 7]>
	<link href="css/style_ie.css" rel="stylesheet" type="text/css" media="screen" />
	<![endif]--> 
        <!--[if lte IE 6]>
	<link href="css/style_ie6.css" rel="stylesheet" type="text/css" media="screen" />
	<![endif]--> 
        <script type="text/javascript" src="js/jquery-1.6.1.js"></script> 
    </head>
    <body>
        <!-- 左 S -->
        <div id="sidebar">
            <div id="logo"><h1><?php echo $_CONFIG['siteName'] .' '. $_CONFIG['ver'];?></h1></div>
            <ul class="items">
                <?php
                foreach ($JA_CONFIG['modules'] as $key => $val) {
                    if (empty($val['actions']))
                        continue;
                    ?>
                    <li<?php if ($_module == $key) { ?> class="active"<?php } ?>>
                        <a href="index.php?mod=<?php echo $key; ?>&act=<?php $_actKeysTemp = array_keys($val['actions']);
                echo $_actKeysTemp[0]; ?>" title="<?php echo isset($val['description']) ? $val['description'] : $val['name']; ?>"><?php echo $val['name']; ?></a>
                    </li>
                    <?php
                }
                ?>
            </ul>
            <span class="clear"></span>
        </div>
        <!-- 左 E -->
        <!-- 右 S -->
        <div id="content">
            <p id="status">欢迎, <?php echo $user->name; ?> (<?php echo $user->role_name; ?>) <a href="?_logout=1" title="Sign Out?">登出?</a></p>
            <h2><span><?php echo $JA_CONFIG['modules'][$_module]['name']; ?></span></h2>
            <p id="description"><?php echo isset($JA_CONFIG['modules'][$_module]['description']) ? $JA_CONFIG['modules'][$_module]['description'] : ''; ?></p>
            <div  class="subitems">
                <ul>
                    <?php
                    if (!empty($JA_CONFIG['modules'][$_module]['actions'])) {
                        foreach ($JA_CONFIG['modules'][$_module]['actions'] as $key => $val) {
                            if (!isset($val[2]) || !$val[2])
                                continue;
                            ?>
                            <li<?php if ($_action == $key) { ?> class="active"<?php } ?>><a href="index.php?mod=<?php echo $_module; ?>&act=<?php echo $key; ?>" title="<?php echo $val[1]; ?>"><?php echo $val[1]; ?></a></li>
                            <?php
                        }
                    }
                    ?>
                </ul>
                <span class="clear"></span>
            </div>